package org.example.use;

import com.li.config.RpcServiceConfig;
import com.li.registry.ServiceRegistry;
import com.li.registry.zk.ZkServiceRegistryImpl;
import com.li.service.HelloService;
import com.li.service.Impl.HelloServiceImpl;

import java.net.InetSocketAddress;

public class Registry {
    public static void main(String[] args) {
        String rpcServiceName="com.li.service.HelloServicegroupLi1";
        InetSocketAddress inetSocketAddress = new InetSocketAddress("172.26.80.1", 9998);
        ServiceRegistry serviceRegistry=new ZkServiceRegistryImpl();

        HelloService helloService=new HelloServiceImpl();
        RpcServiceConfig rpcServiceConfig = RpcServiceConfig.builder()
                .group("groupLi")
                .version("version1")
                .service(helloService)
                .build();
        serviceRegistry.registerService(rpcServiceName,inetSocketAddress);
    }
}
